xen: fail gnttab_grow_table() in case of missing allocations
authorJuergen Gross <jgross@suse.com>
Fri, 29 Sep 2017 10:51:40 +0000 (12:51 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 29 Sep 2017 14:30:16 +0000 (15:30 +0100)
commit13dd8da1e3bac9cce193db582f89a48e46fbb026
tree8c77583e72d2f89e6354934cc2fc37c7002f6107
parent5a879cfe15ae86d4b78bdd57f39c4a034842d73c
xen: fail gnttab_grow_table() in case of missing allocations

In case gnttab_grow_table() is being called without
grant_table_set_limits() having been called for the domain, e.g. in
case of a toolstack error, fail the function instead of crashing the
system.

While at it let gnttab_grow_table() return a proper error code instead
of 1 for success.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/common/grant_table.c